package com.yht.redbook.user.api;

import com.yht.framework.common.response.Response;
import com.yht.redbook.user.constant.ApiConstants;
import com.yht.redbook.user.dto.req.*;
import com.yht.redbook.user.dto.resp.FindUserByIdRspDTO;
import com.yht.redbook.user.dto.resp.FindUserByPhoneRspDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: yht
 * @date: 2024/12/29 16:17
 * @description: TODO
 **/
@FeignClient(name = ApiConstants.SERVICE_NAME)
public interface UserFeignApi {
    String PREFIX = "/user";

    @PostMapping(value = PREFIX + "/register")
    Response<Long> registerUser(@RequestBody RegisterUserReqDTO registerUserReqDTO);

    @PostMapping(value = PREFIX + "/findByPhone")
    Response<FindUserByPhoneRspDTO> findByPhone(@RequestBody FindUserByPhoneReqDTO findUserByPhoneReqDTO);

    @PostMapping(value = PREFIX + "/password/update")
    Response<?> updateUserPassword(@RequestBody UpdateUserPasswordReqDTO updateUserPasswordReqDTO);

    @PostMapping(PREFIX + "/findById")
    Response<FindUserByIdRspDTO> findUserById(@RequestBody FindUserByIdReqDTO findUserByIdReqDTO);

    @PostMapping(PREFIX + "/findUsers")
    Response<List<FindUserByIdRspDTO>> findUsersById(@RequestBody FindUsersByIdReqDTO findUsersByIdReqDTO);
}
